Skip to content

feat(remark-lint): improve validation#8746

Merged
avivkeller merged 1 commit intomainfrom
feat/remark-lint
Mar 21, 2026
Merged

feat(remark-lint): improve validation#8746
avivkeller merged 1 commit intomainfrom
feat/remark-lint

Conversation

@avivkeller
Copy link
Member

Ref: nodejs/node#62090


Adds deprecation validation based on https://github.com/nodejs/node/blob/main/tools/doc/deprecationCodes.mjs, and allows type validation to work in links (i.e. [<Type>]())

@avivkeller avivkeller requested review from a team as code owners March 18, 2026 23:16
Copilot AI review requested due to automatic review settings March 18, 2026 23:16
@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Mar 21, 2026 2:39pm

Request Review

@github-actions
Copy link
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website @nodejs/web-infra

Please review the changes when you have a chance. Thank you! 🙏

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 96.33028% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.27%. Comparing base (ccc1d9f) to head (5061a27).
⚠️ Report is 13 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ges/remark-lint/src/rules/invalid-deprecations.mjs 94.20% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8746      +/-   ##
==========================================
+ Coverage   75.11%   75.27%   +0.15%     
==========================================
  Files         104      105       +1     
  Lines        9167     9242      +75     
  Branches      315      326      +11     
==========================================
+ Hits         6886     6957      +71     
- Misses       2279     2283       +4     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the @node-core/remark-lint API-doc preset to validate deprecation entries and to recognize/normalize type references inside link text.

Changes:

  • Add a new node-core:invalid-deprecations rule (and unit tests) to validate ordering and required metadata blocks in deprecation docs.
  • Update node-core:invalid-type-reference to detect type references via QUERIES.normalizeTypes, including cases like [<Type>]().
  • Bump @node-core/doc-kit dependency (and lockfile) and bump @node-core/remark-lint version to 1.3.0.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Updates lockfile for @node-core/doc-kit@1.0.2 and related dependency graph changes.
packages/remark-lint/src/rules/invalid-type-reference.mjs Adjusts type-reference detection and normalization logic to work in more AST contexts (e.g., link text).
packages/remark-lint/src/rules/invalid-deprecations.mjs Introduces a new rule to validate deprecation codes ordering and presence of required sections.
packages/remark-lint/src/rules/tests/invalid-type-reference.test.mjs Adds coverage for miswrapped type references inside link text.
packages/remark-lint/src/rules/tests/invalid-deprecations.test.mjs Adds unit tests for ordering/type/changes validation in deprecations content.
packages/remark-lint/src/api.mjs Registers the new invalid-deprecations rule in the API preset.
packages/remark-lint/package.json Bumps package version and @node-core/doc-kit dependency range.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

📦 Build Size Comparison

Summary

Metric Value
Old Total Size 3.52 MB
New Total Size 3.52 MB
Delta 0 B (0.00%)

Changes

➕ Added Assets (1)
Name Size
.next/static/chunks/75e7861e3b66c269.js 208.90 KB
➖ Removed Assets (1)
Name Size
.next/static/chunks/92c4df6e37e130bc.js 208.90 KB

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, fine with the PR. Just wondering if it could be documented a bit more, like here type[0] !== '{' || type[type.length - 1] !== '}' you documented it of sorts but on the lines below not much.

Co-Authored-By: Caner Akdas <canerakdas@gmail.com>
Signed-off-by: Aviv Keller <me@aviv.sh>
@avivkeller avivkeller added this pull request to the merge queue Mar 21, 2026
Merged via the queue into main with commit 1dd8a0b Mar 21, 2026
13 checks passed
@avivkeller avivkeller deleted the feat/remark-lint branch March 21, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants